<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('初始化产品账户信息')" />
<!--    <th:block th:include="include :: select2-css" />-->
    <th:block th:include="include :: bootstrap-duallistbox-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-itemProduct-add">
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label is-required">产品ID：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="productId" class="form-control" type="text" required>-->
<!--                </div>-->
<!--            </div>-->
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">产品账户名称：</label>
                    <div class="col-sm-8">
                        <input name="accountName" class="form-control" type="text" required>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">备注：</label>
                    <div class="col-sm-8">
                        <input name="remark" class="form-control" type="text" required>
                    </div>
                </div>
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label is-required">产品名称：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <select name="productId" class="form-control">-->
<!--                        <option  th:each="item:${productList}" th:text="${item.name}" th:value="${item.value}"></option>-->
<!--                    </select>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">-->
<!--                <label class="col-sm-3 control-label is-required">产品名称：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <select class="form-control dual_select" name="productName" id="mulSelect" multiple>-->
<!--                    <option value="1">若依1</option>-->
<!--                    <option value="2">若依2</option>-->
<!--                    <option value="3">若依3</option>-->
<!--                    <option value="4">若依4</option>-->
<!--                    <option value="5">若依5</option>-->
<!--                    <option value="6">若依6</option>-->
<!--                    <option value="7">若依7</option>-->
<!--                    <option value="8">若依8</option>-->
<!--                    <option value="9">若依9</option>-->
<!--                    <option value="10">若依10</option>-->
<!--                    <option value="11">若依11</option>-->
<!--                    <option value="12">若依12</option>-->
<!--                </select>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label is-required">可用余额：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="avaliableAmount" class="form-control" type="text" required>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label is-required">总金额：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="totalAmount" class="form-control" type="text" required>-->
<!--                </div>-->
<!--            </div>-->
        </form>
    </div>
    <th:block th:include="include :: footer" />
<!--    <th:block th:include="include :: select2-js" />-->
    <th:block th:include="include :: bootstrap-duallistbox-js" />
    <script th:inline="javascript">
        var prefix = ctx + "account/itemProduct"
        $("#form-itemProduct-add").validate({
            focusCleanup: true
        });

        $('#mulSelect').bootstrapDualListbox({
            nonSelectedListLabel: '未有用户',
            selectedListLabel: '已有用户',
            preserveSelectionOnMove: 'moved',
            moveOnSelect: false,           // 出现一个剪头，表示可以一次选择一个
            filterTextClear: '展示所有',
            moveSelectedLabel: "添加",
            moveAllLabel: '添加所有',
            removeSelectedLabel: "移除",
            removeAllLabel: '移除所有',
            infoText: '共{0}个',
            showFilterInputs: false,       // 是否带搜索
            selectorMinimalHeight: 160
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-itemProduct-add').serialize());
            }
        }
    </script>
</body>
</html>